package pers.kw.enums;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * The enum Yes or no enum.
 */
public enum YesOrNoEnum {

    /**
     * Yes yes or no enum.
     */
    YES(1, "是"),
    /**
     * No yes or no enum.
     */
    NO(0, "否");

    private final Integer code;
    private final String mark;

    YesOrNoEnum(Integer code, String mark) {
        this.code = code;
        this.mark = mark;
    }

    public Integer getCode() {
        return code;
    }

    public String getMark() {
        return mark;
    }

    public static final List<Map<String, Object>> yesOrNoList = new ArrayList<>(values().length);

    static {
        for (YesOrNoEnum be : values()) {
            Map<String, Object> map = new HashMap<>(2);
            map.put("code", be.code);
            map.put("mark", be.getMark());
            yesOrNoList.add(map);
        }
    }
}
